/*
 * @file gkt_font.h
 */

#ifndef GKT_FONT_H
#define GKT_FONT_H

#include "gkt_types.h"

#ifdef __cplusplus
extern "C" {
#endif

#if defined(GKT_CONFIG_SCREEN_ENABLE) && GKT_CONFIG_SCREEN_ENABLE

#include "gkt_screen.h"

#define GKT_FONT_ENABLE	1

enum {
	GKT_FONT_CODE_ASCII = 0,
	GKT_FONT_CODE_GB2312,
	GKT_FONT_CODE_MAX
};

typedef struct _gkt_font_draw_params {
	uint32_t	size;
	gkt_color_t	fg_color;
	gkt_color_t	bg_color;
	uint32_t	x_space;
	int	update;
} gkt_font_draw_params_s;

typedef struct _gkt_font_text_info {
	uint32_t	character_nums;
	uint32_t	total_width;
} gkt_font_text_info_s;

uint32_t gkt_font_get_width(
				uint32_t code_type, uint32_t font_size);

void gkt_font_get_text_info(
				const char *text, uint32_t font_size,
				gkt_font_text_info_s *text_info);

uint32_t gkt_font_draw_text(
				const char *text, gkt_rect_s *rect, 
				gkt_font_draw_params_s *params);

#else

#define GKT_FONT_ENABLE	0

#endif

#ifdef __cplusplus
}
#endif

#endif	/* GKT_FONT_H */

